import request from "@/utils/request"

// 获取所有品牌
const findAllBrands = () => {
    return request({
        url: "/api/brand/getAllBrands",
        method: "get"
    })
}

// 删除品牌
const deleteBrandById = (id) => {
    return request({
        url: `/api/brand/deleteBrand?bid=${id}`,
        method: "post"
    })
}

// 更新品牌信息
const updateBrand = (brand) => {
    return request({
        url: "/api/brand/updateBrand",
        method: "post",
        headers: { "Content-Type": "application/json;charset=utf-8" },
        data: brand
    })
}

// 新增品牌
const addBrand = (brand) => {
    return request({
        url: "/api/brand/addBrand",
        method: "post",
        headers: { "Content-Type": "application/json;charset=utf-8" },
        data: brand
    })
}

export { findAllBrands, deleteBrandById, updateBrand, addBrand }